<#macro main title module reportType nowpath menulist userinfo verifypath>
<#-- import macro -->
    <#import "header.ftl" as siteHeader />
    <#import "footer.ftl" as siteFooter />
<#-- header -->
    <@siteHeader.header>
    <!-- basic styles -->

    <link href="/assets/ACE/assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/assets/ACE/assets/Font-Awesome-3.2.1/css/font-awesome.min.css"/>
    <#--<link rel="stylesheet" href="/assets/ACE/assets/css/font-awesome.min.css"/>-->
    <link rel="stylesheet" href="/assets/ACE/assets/css/datepicker.css"/>
    <link rel="stylesheet" href="/assets/ACE/assets/css/ui.jqgrid.css"/>
    <link rel="stylesheet" href="/assets/ACE/assets/css/chosen.css"/>
    <link rel="stylesheet" href="/assets/ACE/assets/css/jquery.gritter.css"/>
    <!--[if IE 7]>
    <link rel="stylesheet" href="/assets/ACE/assets/css/font-awesome-ie7.min.css"/>
    <![endif]-->
    <!-- page specific plugin styles -->
    <!-- fonts -->
    <link rel="stylesheet" href="/assets/ACE/assets/css/css.css"/>
    <!-- ace styles -->
    <link rel="stylesheet" href="/assets/ACE/assets/css/ace.min.css"/>
    <link rel="stylesheet" href="/assets/ACE/assets/css/ace-rtl.min.css"/>
    <link rel="stylesheet" href="/assets/ACE/assets/css/ace-skins.min.css"/>
    <script src="http://www.jq22.com/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        if ("ontouchend" in document) document.write("<script src='/assets/ACE/assets/js/jquery.mobile.custom.min.js'>" + "<" + "script>");

    </script>
    <script src="/assets/ACE/assets/js/bootstrap.min.js"></script>
    <script src="/assets/ACE/assets/js/typeahead-bs2.min.js"></script>
    <!-- page specific plugin scripts -->
    <!--[if lte IE 8]>
    <script src="/assets/ACE/assets/js/excanvas.min.js"></script>
    <![endif]-->
    <script src="/assets/ACE/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="/assets/ACE/assets/js/jquery.ui.touch-punch.min.js"></script>
    <script src="/assets/ACE/assets/js/date-time/bootstrap-datepicker.min.js"></script>
    <script src="/assets/ACE/assets/js/jqGrid/jquery.jqGrid.min.js"></script>
    <script src="/assets/ACE/assets/js/jqGrid/i18n/grid.locale-cn.js"></script>
    <!-- ace scripts -->
    <script src="/assets/ACE/assets/js/ace-elements.min.js"></script>
    <script src="/assets/ACE/assets/js/ace.min.js"></script>
    <link href="/assets/bootstrap3.3.5/datetimepicker/bootstrap-datetimepicker.min.css"
          rel="stylesheet" media="screen"/>
    <script src="/assets/bootstrap3.3.5/datetimepicker/bootstrap-datetimepicker.min.js"
            type="text/javascript"></script>
    <script src="/assets/bootstrap3.3.5/datetimepicker/bootstrap-datetimepicker.zh-CN.js"
            type="text/javascript"></script>
    <script src="/assets/ACE/assets/js/chosen.jquery.min.js"></script>
    <script src="/assets/ACE/assets/js/bootbox.min.js"></script>
    <script src="/assets/ACE/assets/js/jquery.gritter.js"></script>
    <script type="text/javascript" src="/assets/javascript/jquery.jmp3.js"></script>
    <script type="text/javascript" src="/assets/javascript/layer/layer.min.js"></script>
    <script type="text/javascript" src="/assets/javascript/public.js?v=1"></script>
    <!--uploadify-->
    <script type="text/javascript" src="/assets/javascript/uploadify/jquery.uploadify.js"></script>
    <link rel="stylesheet" type="text/css" href="/assets/javascript/uploadify/uploadify.css"/>
    <!--uploadify---End-->
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="/assets/ACE/assets/css/ace-ie.min.css"/>
    <![endif]-->
    <!-- inline styles related to this page -->
    <!-- ace settings handler -->
    <script src="/assets/ACE/assets/js/ace-extra.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="/assets/ACE/assets/js/html5shiv.js"></script>
    <script src="/assets/ACE/assets/js/respond.min.js"></script>
    <![endif]-->
    <script src="/assets/pages/utility.js"></script>
    </@siteHeader.header>
<style>
    .ui-jqgrid-view .ui-jqgrid-titlebar, .navbar {
        background-color: #6fb3e0;
    }

    .maincontent {
        margin-left: 0px;
    }
</style>
<div class="navbar navbar-default" id="navbar">
    <script type="text/javascript">
        try {
            ace.settings.check('navbar', 'fixed')
        } catch (e) {
        }


    </script>
    <div class="navbar-container" id="navbar-container">
        <div class="navbar-header pull-left">
            <a href="#" class="navbar-brand">
                <small><i class="icon-leaf"></i>&nbsp;NB-loT数据平台</small>
            </a>
            <!-- /.brand -->
        </div>
        <!-- /.navbar-header -->
        <div class="navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <li class="purple"><a data-toggle="dropdown" class="dropdown-toggle" href="#"><i
                        class="icon-bell-alt icon-animated-bell"></i><span class="badge badge-important msgtotal">
                    </span></a>
                    <ul class="pull-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-close skin-1">
                        <li class="dropdown-header"><i class="icon-warning-sign"></i>消息提示</li>
                        <li class="liorderstate2" style="display: none;"><a
                                href="/Sysmanage/T1/GD/List.aspx?datastatus=2&moduleid=1&Mid=1033">
                            <div class="clearfix">
                                <span class="pull-left"><i class="btn btn-xs no-hover btn-pink icon-list"></i>待接收
                                </span><span class="pull-right badge badge-info gdorderstate2">0</span>
                            </div>
                        </a></li>
                        <li class="liorderstate3" style="display: none;"><a
                                href="/Sysmanage/T1/GD/List.aspx?datastatus=3&moduleid=1&Mid=1034">
                            <div class="clearfix">
                                <span class="pull-left"><i class="btn btn-xs no-hover btn-pink icon-list"></i>待处理
                                </span><span class="pull-right badge badge-info gdorderstate3">0</span>
                            </div>
                        </a></li>
                        <li class="liorderstate4" style="display: none;"><a
                                href="/Sysmanage/T1/GD/List.aspx?datastatus=4&moduleid=1&Mid=1035">
                            <div class="clearfix">
                                <span class="pull-left"><i class="btn btn-xs no-hover btn-success icon-phone"></i>待回访
                                </span><span class="pull-right badge badge-info gdorderstate4">0</span>
                            </div>
                        </a></li>
                        <!--
                        <li><a href="#">
                            <div class="clearfix">
                                <span class="pull-left"><i class="btn btn-xs no-hover btn-pink icon-book"></i>消息
                                </span><span class="pull-right badge badge-info">+12</span>
                            </div>
                        </a></li>
                        <li><a href="#">
                            <div class="clearfix">
                                <span class="pull-left"><i class="btn btn-xs no-hover btn-pink icon-eye-open"></i>
                                </span><span class="pull-right badge badge-info">+12</span>
                            </div>
                        </a></li>
                        -->
                        <li></li>
                    </ul>
                </li>
                <li class="light-blue"><a data-toggle="dropdown" href="#" class="dropdown-toggle"
                                          id="userinfotop"></a>
                    <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li><a href="#"><i class="icon-cog"></i>设置 </a></li>
                        <li><a href="#"><i class="icon-user"></i>个人资料 </a></li>
                        <li class="divider"></li>
                        <li><a href="/sysmanage/LoginOut"><i class="icon-off"></i>退出 </a></li>
                    </ul>
                </li>
            </ul>
            <!-- /.ace-nav -->
        </div>
        <!-- /.navbar-header -->
    </div>
    <!-- /.container -->
</div>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }


    </script>
    <div class="main-container-inner">
        <!--left menu-->
        <div class="sidebar" id="sidebar">
            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'fixed')
                } catch (e) {
                }


            </script>
            <div class="sidebar-shortcuts" id="sidebar-shortcuts" style="display: none">
                <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                    <a class="btn btn-info" data-rel="tooltip" data-placement="top" title="我的工单"
                       href="/Sysmanage/T1/GD/List.aspx?datastatus=3&moduleid=1&totaldata=1&Mid=1034&moduledatatype=-1">
                        <i class="icon-inbox"></i></a><a class="btn btn-warning" data-rel="tooltip" href="javascript:;"
                                                         onclick="PhoneCall();" data-placement="top" title="呼叫中心"><i
                        class="icon-phone"></i>
                </a><a href="/Sysmanage/T1/ServiceUser/List.aspx?Mid=27" class="btn btn-danger" data-rel="tooltip"
                       data-placement="top" title="员工信息"><i class="icon-user"></i></a>
                    <button class="btn btn-success" onclick="return AddNewOrder(-1)" data-rel="tooltip"
                            data-placement="top" title="新增工单">
                        <i class="icon-plus"></i>
                    </button>
                </div>
                <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                    <span class="btn btn-success"></span><span class="btn btn-info"></span><span
                        class="btn btn-warning">
                    </span><span class="btn btn-danger"></span>
                </div>
            </div>
            <!-- #sidebar-shortcuts -->
            <ul id="LeftMenu1_menudiv" class="nav nav-list">

            </ul>
            <!-- /.nav-list -->
            <div class="sidebar-collapse" id="sidebar-collapse">
                <i class="icon-double-angle-left" data-icon1="icon-double-angle-left"
                   data-icon2="icon-double-angle-right">
                </i>
            </div>
        </div>
        <div class="main-content" id="divmaincontent" style="">
            <div class="breadcrumbs" id="contentpath">
                <script type="text/javascript">
                    try {
                        ace.settings.check('breadcrumbs', 'fixed')
                    } catch (e) {
                    }
                </script>
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="#">首页</a></li>
                    <li>控制台${nowpath}</li>
                </ul>
                <!-- .breadcrumb -->
                <div class="nav-search" id="Div2">
                </div>
                <!-- #nav-search -->
            </div>
            <div class="page-content">
                <#nested />
            </div>
            <!-- /.page-content -->
        </div>
        <!-- /.main-content -->
    </div>
    <!-- /.main-container-inner -->
</div>
<script type="text/javascript">
        <#if userinfo>
        var userinfo =${userinfo};
        <#else >
        var userinfo = null;
        </#if>
        <#if verifypath>
        var verifypath ="${verifypath}";
        <#else >
        var verifypath = "";
        </#if>
    var layerloading;
    jQuery(function ($) {
        if (userinfo != null) {
            $('#userinfotop').html(userinfo.name);
        }
        var action = getUrlParam("action");
        if (action == "select") {
            $('#sidebar').hide();
            $('#navbar').hide();
            $('#contentpath').hide();
            //$('#divmaincontent').css("margin-left","0px;");
            $('#divmaincontent').addClass("maincontent");
            //$('#divmaincontent').css("style","margin-left:0px;");
        }
        GetMenuInfo();
    })
    function GetMenuInfo() {

        $("#LeftMenu1_menudiv").html("<li class=\"active\"><a href=\"/sysmanage/main\"><i class=\"icon-dashboard\">"
                + "                </i><span class=\"menu-text\">控制台 </span></a></li>");
        layerloading = layer.load(0, {shade: [0.3, '#fff']}); //0代表加载的风格，支持0-2
        jQuery.ajax({
            type: "get",
            url: "/sysmanage/sys/getusermenudata",
            async: true,
            "data": "",
            "cache": false,
            dataType: 'text',
            "contentType": "application/json; charset=utf-8",
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(XMLHttpRequest.status);
                alert(textStatus);
            },
            success: function (data) {
                var data = JSON.parse(data);
                if (data == undefined || data.length == 0)
                    return;
                var firstdata = data[0];
                if (firstdata.children != undefined) {
                    var nowurl = window.location.href;
                    if (verifypath != "") {
                        nowurl = verifypath;
                        //alert(nowurl);
                    }
                    for (var i = 0; i < firstdata.children.length; i++) {
                        var activeedparent = "";
                        var childrendata = firstdata.children[i];
                        var childrenmenu = "<ul  class=\"submenu\">";
                        if (childrendata.children != undefined) {
                            for (var j = 0; j < childrendata.children.length; j++) {
                                var activeed = "";
                                if (childrendata.children[j].url != "" && nowurl.indexOf(childrendata.children[j].url) > 0) {
                                    activeed = " class=\"active\"";
                                    activeedparent = " class=\"active\"";
                                }
                                childrenmenu += "<li " + activeed + "><a href=\"" + childrendata.children[j].url + "\" title=\"\"><i class=\"icon-double-angle-right\">"
                                        + "                        </i>" + childrendata.children[j].text + " </a></li>";
                            }
                        }
                        childrenmenu += "</ul>";
                        $("#LeftMenu1_menudiv").append("<li " + activeedparent + "><a href=\"#\" class=\"dropdown-toggle\"><i class=\"icon-list\"></i><span class=\"menu-text\">"
                                + childrendata.text + "</span><b class=\"arrow icon-angle-down\"></b></a>" + childrenmenu + "</li>")
                    }
                }
            },
            complete: function (jqXHR, textStatus) {
                layer.close(layerloading);
            }
        })
    }
    function jsunescapedate(cellvalue, options, cell) {
        var unixTimestamp = new Date(cellvalue)
        var commonTime = unixTimestamp.format("yyyy/MM/dd hh:mm:ss");
        return commonTime;
    }
</script>
    <@siteFooter.footer>
        <#if reportType>
        </#if>
    </@siteFooter.footer>
</#macro>